{% extends "accounts/template.html" %}
{% load staticfiles %}
{% block title %}Automan-重置密码{% endblock %}

{% block content %}

{% if validlink %}
<form class="form form-horizontal" action="" method="post">
    {% csrf_token %}
    <div class="row cl">
        <label class="form-label col-xs-3"></label>
        <div class="formControls col-xs-8">
            <h3>重置用户{{ form.user.username }}的密码</h3>
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-3"></label>
        <div class="formControls col-xs-8">
            <input type="password" name="new_password1" class="input-text size-L" maxlength="254" required id="id_new_password1"/>
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-3"></label>
        <div class="formControls col-xs-8">
            <input type="password" name="new_password2" class="input-text size-L" maxlength="254" required id="id_new_password2"/>
        </div>
    </div>
    <div class="row cl text-c">
        <input type="submit" name="reset" class="btn btn-success radius size-L" value="重置密码"/>
    </div>
</form>
{% else %}
<div class="row cl">
    <label class="form-label col-xs-3"></label>
    <div class="formControls col-xs-8">
        <h3>重置密码</h3>
    </div>
</div>
<div class="row cl">
    <label class="form-label col-xs-3"></label>
    <div class="formControls col-xs-8">
        <p>您使用了一个无效的链接，请重试。</p>
    </div>
</div>
<div class="row cl text-c">
    <label class="form-label col-xs-3"></label>
    <div class="formControls col-xs-8">
        <a href="{% url 'password_reset' %}" class="btn btn-secondary btn-block">请求新的密码重置链接</a>
    </div>
</div>
{% endif %}

{% endblock %}